﻿package edu.chds.data.xml{	import flash.events.*;	import flash.net.*;		public class RSSReader extends EventDispatcher	{		private var xmlLoader:URLLoader;		public var feed:XML;		public var episodes:XMLList;		public var title:String;		public var description:String;		public function RSSReader()		{			xmlLoader = new URLLoader();		}				public function load(xmlReq:URLRequest):void		{			xmlLoader.load(xmlReq);			xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);			xmlLoader.addEventListener(IOErrorEvent.IO_ERROR, ioError);		}		private function xmlLoaded(e:Event):void {
			processXML(new XML(e.target.data));		}		public function processXML(NEW_xmlData:XML):void {			feed = NEW_xmlData;			episodes = feed..item;			title = feed.channel.title;			description = feed.channel.description;						dispatchEvent(new Event(Event.COMPLETE));		}		private function ioError(e:IOErrorEvent):void {
			trace("IOError");
		}	}}